//{=======================================================================
//! @file B5.c
//! @date 05.10.2013 3:29
//! @author Andrey Drobyshev <immortalguardian1@gmail.com>
//! @ version 1.0
//!
//! @par	Conditions:
//! 		The program reads a natural number and calculating
//!         its dividers sum.
//}=======================================================================


#include <stdio.h>

//{==============================================================
//! Function main - prints welcome messages and the result,
//! manages all the program execution.
//!
//! @return     0 on success
//}===============================================================

int main ()
{
	printf ( "#Hello!\n"
             "#This program counts the sum of a natural number's dividers.\n"
             "#Please enter your number: ");

    unsigned int n = 0;

	scanf("%d", &n);

	unsigned int i = 0, sum = 0;

	for ( i = 1; i <= n / 2; i++)
		if ( ! ( n % i))
			sum += i;
	sum += n;
	printf ( "#The sum of dividers of the number %u is %u.",  n, sum);
	return 0;
}
